<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    #wai{
      width: 300px;
      height: 300px;
      background-color: blue;
      border: 10px salmon solid;
      margin: 60px;
      overflow: hidden;
    }
    #nei{
      width: 100px;
      height: 100px;
      background-color: red;
      border: 10px thistle solid;
      margin: 50px;
      padding: 10px;
    }
  </style>
</head>
<body>
  <div id="wai">
    <div id="nei"></div>
  </div>
  <script>
    var wai =document.querySelector("#wai");
    var nei = document.querySelector("#nei");
    var nei1 = document.getElementById("nei");
    // client客户端大小
    // 边框区域尺寸(不常用)
    console.log(wai.clientLeft);//border
    console.log(wai.clientTop);//border
    // 边框内部大小（常用）content+padding
    console.log(wai.clientWidth);//content(Width)
    console.log(wai.clientHeight);//content(Height)

    </script>
</body>
</html>